package org.mushroomdb.parser.sql92.impl.util;

import org.mushroomdb.catalog.Table;

public class CorrelatedColumn implements ColumnInterface {

	private ColumnInterface innerColumn;
	private String correlationName = "";
	private CorrelatedTable table; 
	
	public CorrelatedColumn(ColumnInterface column, CorrelatedTable table) {
		this.innerColumn = column;
		this.correlationName = this.innerColumn.getName();
		this.table = table;
	}

	public void setName(String name) {
		this.correlationName = name;
	}
	
	public int getType() {
		return this.innerColumn.getType();
	}

	public int getSize() {
		return this.innerColumn.getSize();
	}

	public int getBytes() {
		return this.innerColumn.getBytes();
	}

	public String getName() {
		return this.correlationName;
	}

	public boolean isFk() {
		return this.innerColumn.isFk();
	}

	public boolean isPk() {
		return this.innerColumn.isPk();
	}

	public boolean isUnique() {
		return this.innerColumn.isUnique();
	}

	public void setFk(boolean fk) {
		this.innerColumn.setFk(fk);		
	}

	public void setPk(boolean pk) {
		this.innerColumn.setPk(pk);
	}

	public void setUnique(boolean unique) {
		this.innerColumn.setUnique(unique);
	}

	public boolean isAllowNulls() {
		return this.innerColumn.isAllowNulls();
	}

	public void setAllowNulls(boolean allowNulls) {
		this.innerColumn.setAllowNulls(allowNulls);
	}

	public Table getTable() {
		return this.table;
	}

}
